import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
import store from './src/store'
import api from './src/api'
import loginApi from './src/api/login'

// 导入API并挂载到Vue原型上，方便在组件中使用
Vue.prototype.$api = api
// 挂载登录API
Vue.prototype.$loginApi = loginApi

Vue.config.productionTip = false

// 添加微信JSBridge初始化检查
// #ifdef MP-WEIXIN
if (typeof window !== 'undefined' && !window.WeixinJSBridge) {
  window.WeixinJSBridge = {};
  window.WeixinJSBridge.invoke = function() {};
  window.WeixinJSBridge.on = function() {};
}
// #endif

App.mpType = 'app'
Vue.prototype.$store = store

const app = new Vue({
  store,
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif 